<T:ViewBase x:Class="WPFExcelReport.TKD09"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"   
                     xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM"   
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    Name="TV"
                    Loaded="Window_Loaded"
     >
    <T:ViewBase.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
    </T:ViewBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Margin="0,0,0.0,0"> 
            <StackPanel>
                <WrapPanel>
                    <TextBlock  Grid.Column="1"  VerticalAlignment="Center" HorizontalAlignment="Center">新</TextBlock>
                    <KD:TSKD02  dwKD="{Binding dwKD,ElementName=TV}"/>
                </WrapPanel>
                <WrapPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Margin="15,0,0,0" Width="20" Height="20"   Click="NewCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock  Grid.Column="1"  VerticalAlignment="Center" HorizontalAlignment="Center">新建:编号</TextBlock>
                        <ex:TXT72  Grid.Column="2" Width="100" MaxLength="20" CharacterCasing="Upper" Text="{Binding KDF,ElementName=TV}"></ex:TXT72>
                    </Grid> 
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0"  Margin="15,0,0,0" Width="20" Height="20"   Click="EditCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                            </Button.Background>
                        </Button>
                      </Grid> 
                </WrapPanel>
                <WrapPanel>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions> 
                    <TextBlock  Grid.Column="1"  VerticalAlignment="Center" HorizontalAlignment="Center">编号</TextBlock>
                    <ex:TXT72  Grid.Column="2" Width="100" MaxLength="8" CharacterCasing="Upper" Text="{Binding KDFFORMULAR1,Source={StaticResource ResourceKey=vwMaster}}"></ex:TXT72>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition> 
                    </Grid.ColumnDefinitions>
                        <Button Grid.Column="0"  Margin="15,0,0,0" Width="20" Height="20"   Click="SaveCommand">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                </WrapPanel>
            </StackPanel>
        </StackPanel>
        <DataGrid 
            Grid.Row="1"
            Name="dlgMaster"
            AutoGenerateColumns="False"
            EnableRowVirtualization="False"  
            ItemsSource="{Binding Source={StaticResource vwMaster}}" 
            HeadersVisibility="Column"
            IsSynchronizedWithCurrentItem="True"
            HorizontalScrollBarVisibility="Auto"  
            VerticalScrollBarVisibility="Auto"  Margin="0,0,0.0,0" 
            >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=KDKUNDNA}" Header="{Binding Source={Localization:Translate Word=客户}}"   Width="Auto"  MinWidth="60"/>
                <DataGridTextColumn Binding="{Binding Path=KDFFORMULAR1}" Header="{Binding Source={Localization:Translate Word=格式}}"  Width="Auto" MinWidth="60"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</T:ViewBase>
